<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/token.jsp"%>
<%@ include file="/common/operatehistory.jsp"%>
<%@ include file="/common/code.jsp"%>
<%@ include file="/common/user.jsp"%>
<%
	User self = userByUid(token.getUid());
	if (self == null || self.getType().equals(USER_EMPLOYEE)) {
		Tools.encryptPrint(out, new Message(30041, "您暂时不可以关注科室"));
		return;
	}
	// 关注科室
	String code = input.getDesc("code", "").trim();
	OperateHistory oh = OperateHistory.fromMap(parameters, OperateHistory.class);
	// 扫描二维码形式
	if (!code.equals("")) {
		Message codeMsg = decodeQrCode(code);
		if (codeMsg.getErrcode() != 0) {
			Tools.encryptPrint(out, codeMsg);
			return;
		}
		Map codeMap = (Map)codeMsg.get("code");
		String type = Tools.getDesc(codeMap.get("type"));
		String id = Tools.getDesc(codeMap.get("id"));
		oh.setOid(id);
	}
	oh.setUid(token.getUid() + "");
	oh.setCategory(DEPT_CATEGORY);
	oh.setOperate(ATTENTION);
	Tools.encryptPrint(out, operate(oh, false));
%>
